WMI Requests

Download this manual as a PDF file

In SL1, each WMI Dynamic Application must include at least one WMI or WBEM request.

Collection objects in WMI Dynamic Applications objects are populated with the values returned by a WMI request. WMI requests use WQL (WMI Query Language) to query WMI classes (tables) to retrieve data. A single WMI request can populate multiple WMI objects by querying for multiple class properties (table columns). WBEM objects are populated with values returned by the wbemcli "get instance" command.

Collection objects for both WMI and WBEM are aligned with properties (columns). The definition of each object specifies the WMI or WBEM request that will populate the collection object and the property name to align with the object. The retrieved values of the property will populate the object.

To more easily understand WMI, you can compare the terminology to standard SQL terminology:

WMI SQL
Namespace

Database

Class

Table

Property

Column

Instance Row

This section includes the following topics:

Defining a WMI Request

You can define a WMI request in the WMI Request Editor & Registry page. To define a WMI request:

  • Go to the Dynamic Applications Manager page (System > Manage > Applications).
  • In the Dynamic Applications Manager page, find the Dynamic Application for which you want to define a WMI request. Select its wrench icon ().
  • Select the WMI Requests tab for the Dynamic Application.

NOTE: The WMI Requests tab will only appear in Dynamic Applications of type WMI Config and WMI Performance.

  • In the WMI Request Editor & Registry page, enter the following:
  • WMI Request Name. Name of the WMI request.
  • WMI Request Type. Specifies whether to use a WMI request (query) or a WBEM request (a wbemcli "get instance" request sent over HTTP).
  • WMI Request Namespace. Optional field. In this field, you can specify a WMI namespace. The WMI request will then use this namespace when requesting data. If you do not specify a value in this field, the WMI request will use the default namespace (usually root).
  • WMI Object Key. The unique key for each instance (row) returned by the request. This unique key must be a property name, and the request must include that property (column) and return values from that property name (column). You must choose a key that remains constant over all polling periods, for example "Name" or "servicename".
  • Active State. Specifies whether SL1 should use this request when performing collection for the Dynamic Application. Choices are:
  • Enabled. SL1 will use the WMI request when performing collection for the Dynamic Application.
  • Disabled. SL1 will not use the WMI request when performing collection for the Dynamic Application.
  • WMI Request Query. Enter the WQL query in this field. In most cases, these queries will be of the format:

SELECT [one or more properties (columns), separated by commas] FROM name of WMI class (table) where data is stored]

For more information on WQL, see http://msdn.microsoft.com/en-us/library/aa394606%28VS.85%29.aspx

For more information on WMI classes, see http://msdn.microsoft.com/en-us/library/aa394554(v=VS.85).aspx

For a comparison of WQL and SQL, see http://technet.microsoft.com/en-us/library/cc180454.aspx

Example WMI Code

For our example Dynamic Application, we'll use the following WMI request:

SELECT TotalVisibleMemorySize,CSName,Caption,SerialNumber FROM Win32_OperatingSystem

In this request, we are retrieving the property (column) values from the WMI class (table) Win32_OperatingSystem. Win32_OperatingSystem is a class (table) that stores information about an instance of an operating system running on the monitored device. From this class, the WMI request retrieves the values of the following properties:

  • TotalVisibleMemorySize. Total amount, in kilobytes, of physical memory available to the operating system. This value does not necessarily indicate the true amount of physical memory, but only the amount that is reported to the operating system as available to it. In our example Dynamic Application, we can create an object that maps to this property. To map an object to the retrieved value from this property, we must ensure that the WMI Request Arguments field for the object (in the Collection Objects page) contains the value "TotalVisibleMemorySize".
  • CSName. Name of the computer system (device name as it appears to the operating system). In our example Dynamic Application, we can create an object that maps to this property. To map an object to the retrieved value from this property, we must ensure that the WMI Request Arguments field for the object (in the Collection Objects page) contains the value "CSName".
  • Caption. This is a short description of the operating system version. For example, "Microsoft Windows XP Professional Version = 5.1.2500". In our example Dynamic Application, we can create an object that maps to this property. To map an object to the retrieved value from this property, we must ensure that the WMI Request Arguments field (in the Collection Objects page) contains the value "Caption".
  • SerialNumber. Operating system product serial identification number. For example: "10497-OEM-0031416-71674". In our example Dynamic Application, we can create an object that maps to this property. To map an object to the retrieved value from this property, we must ensure that the WMI Request Arguments field (in the Collection Objects page) contains the value "SerialNumber".

Defining a WBEM Request

You can define a WBEM request in the WMI Request Editor & Registry page. To define a WBEM request in the WMI Request Editor & Registry page:

  • Go to the Dynamic Applications Manager page (System > Manage > Applications).
  • In the Dynamic Applications Manager page, find the Dynamic Application for which you want to define a WBEM request. Select its wrench icon ().
  • Select the WMI Requests tab for the Dynamic Application.

  • In the WMI Request Editor & Registry page, enter the following:
  • WMI Request Name. Name of the WBEM request.
  • WMI Request Type. Specifies whether to use a WMI request (a query) or a WBEM request (a wbemcli "get instance" request sent over HTTP).
  • WMI Request Namespace. Optional field. In this field, you can specify a WMI namespace (database). The WBEM request will then use this namespace (databse) when requesting data. If you do not specify a value in this field, the WBEM request will use the default namespace (usually root).
  • WMI Object Key. The unique key for each instance (row) returned by the query. This unique key must be a property name, and the query must include that property (column) and return values from that property name (column).
  • Active State. Specifies whether SL1 should use this request when performing collection for the Dynamic Application. Choices are:

  • Enabled. SL1 will use the WBEM request when performing collection for the Dynamic Application.
  • Disabled. SL1 will not use the WBEM request when performing collection for the Dynamic Application.
  • WMI Request Query. Enter the wbemcli string in this field. In most cases, this will be of the format:

/[name space]:[class name].property=value (this last argument is optional)

Usually, wbemcli requires that the request begins with the full path to the CIM object, including:

http://username:password@hostname or IP:port,

SL1 uses the credentials for the Dynamic Application to automatically append this string to the front of each wbemcli request.

For more information on wbemcli, see http://linux.die.net/man/1/wbemcli

  • Select the Save button to save the new WBEM request.

Example WBEM Request Code

For our example Dynamic Application, we'll use the following WMI request:

/root/cimv2:CIM_OperatingSystem

  • In this request, we are retrieving value from the namespace (database) called /root/cimv2.
  • We are requesting all values from the class (table) called CIM_OperatingSystem.
  • This request will return all values from the class CIM_OperatingSystem. The values will be returned in the format

property_name="value"

  • Each WBEM object (defined in the Collection Objects page) must map to a property name returned by a WBEM request. To map each object, you must have specified a value in the WMI Request Arguments field that matches the name of a property returned by this request.

NOTE: Before defining objects for a WBEM request, you must know which property names will be returned.

Editing a WMI Request

To edit a WMI request in the WMI Request Editor & Registry page:

  1. Go to the Dynamic Applications Manager page (System > Manage > Applications).
  2. In the Dynamic Applications Manager page, find the Dynamic Application for which you want to edit a WMI request. Select its wrench icon ().
  3. Select the WMI Requests tab for the Dynamic Application.
  4. In the WMI Request Editor & Registry page, find the WMI request in the WMI Request Registry pane. Select its wrench icon ().
  5. The fields in the top pane are populated with values from the selected WMI request. You can edit the value of one or more fields. For a description of each field, see the section .
  6. Select the Save button to save your changes to the WMI request.

Editing a WBEM Request

You can edit a WBEM Request the same way you edit a WMI request. To view these steps, see the section Editing a WMI Request.

Deleting a WMI or WBEM Request

To delete a WMI or WBEM request in the WMI Request Editor & Registry page:

  1. Go to the Dynamic Applications Manager page (System > Manage > Applications).
  2. In the Dynamic Applications Manager page, find the Dynamic Application for which you want to delete a WMI request or WBEM request. Select its wrench icon ().
  3. Select the WMI Requests tab for the Dynamic Application.
  4. In the WMI Request Editor & Registry page, find the request you want to delete in the WMI Request Registry pane. Select its bomb icon ().